<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<script src="js/angular.js"></script>
<body ng-app="myApp" ng-controller=myCtrl>
<input type="text" ng-model="text" name="" id="">
</body>
<script>
    angular.module('myApp',[]).controller('myCtrl', function ($scope) {
        $scope.text="";
        $scope.$watch('text', function (newValue, oldValue) {
            console.log($scope.text.length);
        });
    })
//随便写一行发发发
</script>
</html>